package com.sqsf.util;

import com.alibaba.druid.pool.DruidDataSource;

import java.util.ResourceBundle;

public class DruidFactory {
    private static String driver;
    private static String url;
    private static String username;
    private static String password;

    static{
        ResourceBundle jdbc = ResourceBundle.getBundle("jdbc");
        driver=jdbc.getString("jdbc.driver");
        url=jdbc.getString("jdbc.url");
        username=jdbc.getString("jdbc.username");
        password=jdbc.getString("jdbc.password");
    }

    public DruidDataSource druid(){
        DruidDataSource druid=new DruidDataSource();
        druid.setDriverClassName(driver);
        druid.setUrl(url);
        druid.setUsername(username);
        druid.setPassword(password);
        return  druid;
    }
}